package com.dgut.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * 采买方
 */
@Data
@TableName("buyer")
public class Buyer {
    /**
     * 用户名（为表主键且为来自用户表的外键）
     */
    @TableId(type = IdType.INPUT)
    private Integer id;

    /**
     * 电子邮箱
     */
    private String email;


    /**
     * 手机号
     */
    private String phone;

    /**
     * 头像
     */
    private String headPortrait;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 姓名
     */
    private String name;

    /**
     * 性别
     */
    private String sex;

    /**
     * 身份证
     */
    private String idCard;

    /**
     * 出生日期
     */
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date birthDate;

    /**
     * 所在地址
     */
    private String address;

    /**
     * 状态（正常、冻结）
     */
    private String state;

    public Buyer(Integer id, String email, String phone, String headPortrait, String nickname, String name, String sex, String idCard, Date birthDate, String address, String state) {
        this.id = id;
        this.email = email;
        this.phone = phone;
        this.headPortrait = headPortrait;
        this.nickname = nickname;
        this.name = name;
        this.sex = sex;
        this.idCard = idCard;
        this.birthDate = birthDate;
        this.address = address;
        this.state = state;
    }

    public Buyer(){}
}
